Update oXs_out_frsky.cpp
[openXsensor.git] / oXs_Configurator / Python 37 Sources / oxsConfig.py
blob3c8183ae5d02b517969a9a671d070e641f22ea52
1 from tkinter import StringVar , Tk , W ,E , S , BOTH, HIDDEN, DoubleVar , Spinbox , IntVar , filedialog
2 from tkinter import ttk
3 from tkinter import messagebox
5 #from impExp import *
6 import configparser
8 #from oxsConfigurator import protocolChanged
9 #from oxsPpm import ppmTypeChanged
11 configUploadFileName = None
13 config = configparser.ConfigParser()
14 config.add_section("Main")
15 config.add_section("Ppm")
16 config.add_section("Imu")
17 config.add_section("Magnet")
18 config.add_section("Vario")
19 config.add_section("Airspeed")
20 config.add_section("Voltage")
21 config.add_section("Current")
22 config.add_section("Ads")
23 config.add_section("Flow")
24 config.add_section("Rpm")
25 config.add_section("Gps")
26 config.add_section("Memory")
27 config.add_section("AddFields")
28 config.add_section("Frsky")
29 config.add_section("Multiplex")
30 config.add_section("Hott")
31 config.add_section("Jeti")
33 def generateOxsConfig():
34 f=open("oXs_config_basic.h" , 'w')
35 fa=open("oXs_config_advanced.h" , 'w')
36 f.write("#ifndef OXS_CONFIG_BASIC_h\n")
37 f.write("#define OXS_CONFIG_BASIC_h\n")
38 f.write("\n")
39 fa.write("#ifndef OXS_CONFIG_ADVANCED_h\n")
40 fa.write("#define OXS_CONFIG_ADVANCED_h\n")
41 fa.write("\n")
42 fa.write(f"#define PIN_SERIALTX {pinToRxVar.get()}\n")
43 f.write(f"\n#define PROTOCOL {protocolVar.get()}\n\n")
44 if (protocolVar.get() == 'FRSKY_SPORT' or
45 protocolVar.get() == 'FRSKY_SPORT_HUB' or
46 protocolVar.get() == 'FRSKY_HUB') :
47 if frskyVfasVar.get() != 'Not sent':
48 f.write(f"#define VFAS_SOURCE {frskyVfasVar.get()}\n")
49 if frskyFuelVar.get() != 'Not sent':
50 f.write(f"#define FUEL_SOURCE {frskyFuelVar.get()}\n")
51 if frskyA3Var.get() != 'Not sent':
52 f.write(f"#define A3_SOURCE {frskyA3Var.get()}\n")
53 if frskyA4Var.get() != 'Not sent':
54 f.write(f"#define A4_SOURCE {frskyA4Var.get()}\n")
55 if frskyAccxVar.get() != 'Not sent':
56 f.write(f"#define ACCX_SOURCE {frskyAccxVar.get()}\n")
57 if frskyAccyVar.get() != 'Not sent':
58 f.write(f"#define ACCY_SOURCE {frskyAccyVar.get()}\n")
59 if frskyAcczVar.get() != 'Not sent':
60 f.write(f"#define ACCZ_SOURCE {frskyAcczVar.get()}\n")
61 if frskyT1Var.get() != 'Not sent':
62 f.write(f"#define T1_SOURCE {frskyT1Var.get()}\n")
63 if frskyT2Var.get() != 'Not sent':
64 f.write(f"#define T2_SOURCE {frskyT2Var.get()}\n")
66 if protocolVar.get() == 'FRSKY_SPORT' or protocolVar.get() == 'FRSKY_SPORT_HUB':
67 fa.write("\n#define DATA_ID_VARIO 0x00\n")
68 fa.write("#define DATA_ID_FLVSS 0xA1\n")
69 fa.write("#define DATA_ID_FAS 0x22\n")
70 fa.write("#define DATA_ID_GPS 0x83\n")
71 fa.write("#define DATA_ID_RPM 0xE4\n")
72 fa.write("#define DATA_ID_ACC 0x67\n")
73 fa.write("#define DATA_ID_TX 0x0D\n")
75 if protocolVar.get() == 'JETI':
76 if jetiVoltageSourceVar.get() != 'Not sent':
77 f.write(f"#define VOLTAGE_SOURCE {jetiVoltageSourceVar.get()}\n")
78 if jetiTemperatureSourceVar.get() != 'Not sent':
79 f.write(f"#define TEMPERATURE_SOURCE {jetiTemperatureSourceVar.get()}\n")
81 if protocolVar.get() == 'HOTT':
82 if hottCellUndervoltageVar.get() > 0:
83 f.write(f"#define CELL_UNDERVOLTAGE_WARNING {hottCellUndervoltageVar.get()}\n")
84 if hottBattery1SourceVar.get() != 'Not sent':
85 f.write(f"#define BATTERY_1_SOURCE {hottBattery1SourceVar.get()}\n")
86 if hottBattery2SourceVar.get() != 'Not sent':
87 f.write(f"#define BATTERY_2_SOURCE {hottBattery2SourceVar.get()}\n")
88 if hottMainBatterySourceVar.get() != 'Not sent':
89 f.write(f"#define MAIN_BATTERY_SOURCE {hottMainBatterySourceVar.get()}\n")
90 if hottT1SourceVar.get() != 'Not sent':
91 f.write(f"#define TEMPERATURE_1_SOURCE {hottT1SourceVar.get()}\n")
92 if hottT2SourceVar.get() != 'Not sent':
93 f.write(f"#define TEMPERATURE_2_SOURCE {hottT2SourceVar.get()}\n")
95 if protocolVar.get() == 'MULTIPLEX':
96 if (multiplexLine1Var.get() != 'Not sent') or (multiplexLine2Var.get() != 'Not sent') or (multiplexLine3Var.get() != 'Not sent') or \
97 (multiplexLine4Var.get() != 'Not sent') or (multiplexLine5Var.get() != 'Not sent') or (multiplexLine6Var.get() != 'Not sent'):
98 f.write("#define SETUP_MULTIPLEX_DATA_TO_SEND ")
99 firstLine = True
100 if multiplexLine1Var.get() != 'Not sent':
101 firstLine = False
102 f.write("\\")
103 f.write(f"\n 1, {multiplexLine1Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
104 if multiplexLine2Var.get() != 'Not sent':
105 if firstLine == False:
106 f.write(" , ")
107 else:
108 firstLine = False
109 f.write("\\")
110 f.write(f"\n 2, {multiplexLine2Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
111 if multiplexLine3Var.get() != 'Not sent':
112 if firstLine == False:
113 f.write(" , ")
114 else:
115 firstLine = False
116 f.write("\\")
117 f.write(f"\n 3, {multiplexLine3Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
118 if multiplexLine4Var.get() != 'Not sent':
119 if firstLine == False:
120 f.write(" , ")
121 else:
122 firstLine = False
123 f.write("\\")
124 f.write(f"\n 4, {multiplexLine4Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
125 if multiplexLine5Var.get() != 'Not sent':
126 if firstLine == False:
127 f.write(" , ")
128 else:
129 firstLine = False
130 f.write("\\")
131 f.write(f"\n 5, {multiplexLine5Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
132 if multiplexLine6Var.get() != 'Not sent':
133 if firstLine == False:
134 f.write(" , ")
135 else:
136 firstLine = False
137 f.write("\\")
138 f.write(f"\n 6, {multiplexLine6Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
139 if multiplexLine7Var.get() != 'Not sent':
140 if firstLine == False:
141 f.write(" , ")
142 else:
143 firstLine = False
144 f.write("\\")
145 f.write(f"\n 7, {multiplexLine7Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
146 if multiplexLine8Var.get() != 'Not sent':
147 if firstLine == False:
148 f.write(" , ")
149 else:
150 firstLine = False
151 f.write("\\")
152 f.write(f"\n 8, {multiplexLine8Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
153 if multiplexLine9Var.get() != 'Not sent':
154 if firstLine == False:
155 f.write(" , ")
156 else:
157 firstLine = False
158 f.write("\\")
159 f.write(f"\n 9, {multiplexLine9Var.get()} , 1 , 1 , 0 , -16384 , 16383 ")
160 f.write("\n")
161 else:
162 messagebox.showwarning("Warning","Generated files will be unvalid:\n for Multiplex protocol, you must specify the field(s) to be sent")
164 if addFieldsExist.get() == "On":
165 if fillTest1VarioTemperatureVar.get() == "On":
166 fa.write("\n#define FILL_TEST_1_VARIO_TEMP\n")
167 if fillTest2VarioTemperatureVar.get() == "On":
168 fa.write("\n#define FILL_TEST_2_VARIO_TEMP\n")
169 if fillTest3VarioTemperatureVar.get() == "On":
170 fa.write("\n#define FILL_TEST_3_VARIO_TEMP\n")
171 if fillTest3ExpectedAltitudeVar.get() == "On":
172 fa.write("\n#define FILL_TEST_3_WITH_EXPECTED_ALT\n")
173 fa.write(f"\n#define EXPECTED_ALT_AT_SEC {str(expAltTimeVar.get())}\n")
174 if fillTest123LinearAccVar.get() == "On":
175 fa.write("\n#define FILL_TEST_1_2_3_WITH_LINEAR_ACC\n")
176 if fillTest12VspeedAltVar.get() == "On":
177 fa.write("\n#define FILL_TEST_1_2_WITH_VSPEED_AND_ALT_FROM_SECOND_VARIO\n")
178 if fillTest1DteVar.get() == "On":
179 fa.write("\n#define FILL_TEST_1_WITH_DTE\n")
180 if fillTest2PpmAirspeedCompVar.get() == "On":
181 fa.write("\n#define FILL_TEST_2_WITH_PPM_AIRSPEED_COMPENSATION\n")
182 if fillTest1YawRateVar.get() == "On":
183 fa.write("\n#define FILL_TEST_1_WITH_YAWRATE\n")
184 if fillTest1HeadingVar.get() == "On":
185 fa.write("\n#define FILL_TEST1_WITH_HEADING_FROM_MAGNETOMETER\n")
186 if fillTest123FlowVar.get() == "On":
187 fa.write("\n#define FILL_TEST_1_2_3_WITH_FLOW_SENSOR_CONSUMPTION\n")
188 if fillTest1GpsNbrSatVar.get() == "On":
189 fa.write("\n#define FILL_TEST1_WITH_GPS_NUMBER_OF_SAT\n")
190 if fillTest2GpsHdopVar.get() == "On":
191 fa.write("\n#define FILL_TEST2_WITH_GPS_HDOP\n")
193 if ppmExist.get() == "On":
194 if ppmTypeVar.get() == 'Rx chanel':
195 fa.write(f"\n#define PIN_PPM {str(ppmPinVar.get())}\n")
196 fa.write(f"#define PPM_MIN_100 {str(ppmForMin100Var.get())}\n")
197 fa.write(f"#define PPM_PLUS_100 {str(ppmForPlus100Var.get())}\n")
198 else:
199 fa.write("\n#define PPM_VIA_SPORT \n")
201 if persistentExist.get() == "On":
202 f.write("\n#define SAVE_TO_EEPROM YES\n")
203 f.write(f"\n#define PIN_PUSHBUTTON {str(pushButtPinVar.get())}\n")
204 else:
205 f.write("\n#define SAVE_TO_EEPROM NO\n")
207 if varioExist.get() == "On":
208 f.write(f"#define FIRST_BARO_SENSOR_USE {varioTypeVar.get()}\n")
209 if varioTypeVar.get() == 'BMP280':
210 fa.write("#define BMP280_ADR 0x76\n")
211 f.write(f"#define VSPEED_SOURCE {varioSourceVar.get()}\n")
212 if secondBaroExist.get() == 'On':
213 fa.write("\n#define SECOND_BARO_SENSOR_USE MS5611\n")
214 else:
215 fa.write("\n#define SECOND_BARO_SENSOR_USE NO_BARO\n")
216 fa.write("\n#define SENSITIVITY_MIN 80\n")
217 fa.write("#define SENSITIVITY_MAX 300\n")
218 fa.write("#define SENSITIVITY_MIN_AT 100\n")
219 fa.write("#define SENSITIVITY_MAX_AT 1000\n")
220 if ppmExist.get() == "On":
221 fa.write("\n#define SENSITIVITY_MIN_AT_PPM 10\n")
222 fa.write("#define SENSITIVITY_MAX_AT_PPM 40\n")
223 fa.write("#define SENSITIVITY_PPM_MIN 20\n")
224 fa.write("#define SENSITIVITY_PPM_MAX 100\n")
225 fa.write(f"\n#define VARIOHYSTERESIS {str(varioHysteresisVar.get())}\n")
226 if analogVarioExist.get() == "On":
227 fa.write(f"\n#define PIN_ANALOG_VSPEED {varioAnalogPinVar.get()}\n")
228 fa.write(f"#define ANALOG_VSPEED_MIN {varioAnalogMinVar.get()}\n")
229 fa.write(f"#define ANALOG_VSPEED_MAX {varioAnalogMaxVar.get()}\n")
230 else:
231 f.write("#define FIRST_BARO_SENSOR_USE NO_BARO\n")
233 if airspeedExist.get() == "On":
234 f.write(f"#define AIRSPEED_SENSOR_USE {airspeedTypeVar.get()}\n")
235 if airspeedAtSea15CVar == "On":
236 fa.write("\n#define AIRSPEED_AT_SEA_LEVEL_AND_15C\n")
237 if airspeedInKmhVar == "On":
238 fa.write("\n#define AIRSPEED_IN_KMH\n")
239 fa.write(f"\n#define AIRSPEED_RESET_AT_PPM {airspeedResetAtPpmVar.get()}\n")
240 fa.write(f"\n#define COMPENSATION_MIN_AT_PPM {airspeedCompMinAtPpmVar.get()}\n")
241 fa.write(f"\n#define COMPENSATION_MAX_AT_PPM {airspeedCompMaxAtPpmVar.get()}\n")
242 fa.write(f"\n#define COMPENSATION_PPM_MIN {airspeedCompMinVar.get()}\n")
243 fa.write(f"\n#define COMPENSATION_PPM_MAX {airspeedCompMaxVar.get()}\n")
244 else:
245 f.write("\n#define AIRSPEED_SENSOR_USE NO_AIRSPEED\n")
247 if voltageExist.get() == "On":
248 f.write("\n#define ARDUINO_MEASURES_VOLTAGES YES\n")
249 f.write(f"#define NUMBEROFCELLS {voltNumberOfCellsVar.get()}\n")
250 if voltReferenceVar.get() == "Internal":
251 fa.write("\n#define USE_INTERNAL_REFERENCE\n")
252 elif voltReferenceVar.get() == "External":
253 fa.write("\n#define USE_EXTERNAL_REFERENCE\n")
254 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
255 else:
256 fa.write(f"\n#define REFERENCE_VOLTAGE {str(voltRefValueVar.get())}\n")
257 fa.write(f"\n#define PIN_VOLTAGE ")
258 if volt1Exist.get() == 'On':
259 fa.write(f" {volt1PinVar.get()} , ")
260 else:
261 fa.write("8 , ")
262 if volt2Exist.get() == 'On':
263 fa.write(f" {volt2PinVar.get()} , ")
264 else:
265 fa.write("8 , ")
266 if volt3Exist.get() == 'On':
267 fa.write(f" {volt3PinVar.get()} , ")
268 else:
269 fa.write("8 , ")
270 if volt4Exist.get() == 'On':
271 fa.write(f" {volt4PinVar.get()} , ")
272 else:
273 fa.write("8 , ")
274 if volt5Exist.get() == 'On':
275 fa.write(f" {volt5PinVar.get()} , ")
276 else:
277 fa.write("8 , ")
278 if volt6Exist.get() == 'On':
279 fa.write(f" {volt6PinVar.get()} \n")
280 else:
281 fa.write("8\n")
282 fa.write((f"#define RESISTOR_TO_GROUND {volt1RgVar.get()} , " +
283 f"{volt2RgVar.get()} , {volt3RgVar.get()} , {volt4RgVar.get()} , " +
284 f"{volt5RgVar.get()} , {volt6RgVar.get()}\n"))
285 fa.write((f"#define RESISTOR_TO_VOLTAGE {volt1RvVar.get()} , " +
286 f"{volt2RvVar.get()} , {volt3RvVar.get()} , {volt4RvVar.get()} , " +
287 f"{volt5RvVar.get()} , {volt6RvVar.get()}\n"))
288 fa.write((f"#define OFFSET_VOLTAGE {volt1OffsetVar.get()} , " +
289 f"{volt2OffsetVar.get()} , {volt3OffsetVar.get()} , {volt4OffsetVar.get()} , " +
290 f"{volt5OffsetVar.get()} , {volt6OffsetVar.get()}\n"))
291 fa.write((f"#define SCALE_VOLTAGE {volt1ScaleVar.get()} , " +
292 f"{volt2ScaleVar.get()} , {volt3ScaleVar.get()} , {volt4ScaleVar.get()} , " +
293 f"{volt5ScaleVar.get()} , {volt6ScaleVar.get()}\n"))
294 else:
295 f.write("\n#define ARDUINO_MEASURES_VOLTAGES NO\n")
297 if currentExist.get() == "On":
298 f.write("\n#define ARDUINO_MEASURES_A_CURRENT YES\n")
299 fa.write(f"\n#define PIN_CURRENTSENSOR {currentPinVar.get()}\n")
300 fa.write(f"#define MVOLT_AT_ZERO_AMP {str(currentMvoltAt0Var.get())}\n")
301 fa.write(f"#define MVOLT_PER_AMP {str(currentMvoltPerAmpVar.get())}\n")
302 fa.write(f"#define RESISTOR_TO_GROUND_FOR_CURRENT {str(currentRgVar.get())}\n")
303 fa.write(f"#define RESISTOR_TO_CURRENT_SENSOR {str(currentRcVar.get())}\n")
304 else:
305 f.write("\n#define ARDUINO_MEASURES_A_CURRENT NO\n")
307 if adcExist.get() == "On":
308 if (Adc0TypeVar.get() != "ADS_OFF") or (Adc1TypeVar.get() != "ADS_OFF") or (Adc2TypeVar.get() != "ADS_OFF") or (Adc3TypeVar.get() != "ADS_OFF"):
309 f.write("\n#define AN_ADS1115_IS_CONNECTED YES\n")
310 fa.write(f"\n#define ADS_MEASURE {Adc0TypeVar.get()}, {Adc1TypeVar.get()}, {Adc2TypeVar.get()}, {Adc3TypeVar.get()}\n")
311 fa.write(f"#define ADS_FULL_SCALE_VOLT {Adc0FsVar.get()}, {Adc1FsVar.get()}, {Adc2FsVar.get()}, {Adc3FsVar.get()}\n")
312 fa.write(f"#define ADS_OFFSET {str(Adc0OffVar.get())}, {str(Adc1OffVar.get())}, {str(Adc2OffVar.get())}, {str(Adc3OffVar.get())}\n")
313 fa.write(f"#define ADS_SCALE {str(Adc0ScVar.get())}, {str(Adc1ScVar.get())}, {str(Adc2ScVar.get())}, {str(Adc3ScVar.get())}\n")
314 fa.write(f"#define ADS_RATE {Adc0CrVar.get()}, {Adc1CrVar.get()}, {Adc2CrVar.get()}, {Adc3CrVar.get()}\n")
315 if Adc0AvgVar.get()<1:
316 Adc0AvgVar.set(1)
317 if Adc1AvgVar.get()<1:
318 Adc1AvgVar.set(1)
319 if Adc2AvgVar.get()<1:
320 Adc2AvgVar.set(1)
321 if Adc3AvgVar.get()<1:
322 Adc3AvgVar.set(1)
323 if Adc0AvgVar.get()>254:
324 Adc0AvgVar.set(254)
325 if Adc1AvgVar.get()>254:
326 Adc1AvgVar.set(254)
327 if Adc2AvgVar.get()>254:
328 Adc2AvgVar.set(254)
329 if Adc3AvgVar.get()>254:
330 Adc3AvgVar.set(254)
331 fa.write(f"#define ADS_AVERAGING_ON {str(Adc0AvgVar.get())}, {str(Adc1AvgVar.get())}, {str(Adc2AvgVar.get())}, {str(Adc3AvgVar.get())}\n")
332 if AdcCurrVar.get() != "NO":
333 fa.write(f"#define ADS_CURRENT_BASED_ON {AdcCurrVar.get()}\n")
334 if AdcSpVar.get() != "NO":
335 fa.write(f"#define ADS_AIRSPEED_BASED_ON {AdcSpVar.get()}\n")
336 else:
337 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
338 else:
339 f.write("\n#define AN_ADS1115_IS_CONNECTED NO\n")
341 if rpmExist.get() == "On":
342 f.write("\n#define CALCULATE_RPM YES\n")
343 fa.write(f"\n#define PULSES_PER_ROTATION {pulsesPerRotationVar.get()}\n")
344 else:
345 f.write("\n#define CALCULATE_RPM NO\n")
347 if gpsExist.get() == "On":
348 f.write("\n#define A_GPS_IS_CONNECTED YES\n")
349 if gpsTimeExist.get() == 'On':
350 fa.write("\n#define GPS_TRANSMIT_TIME\n")
351 if gps3dExist.get() == 'On':
352 fa.write("\n#define GPS_SPEED_3D\n")
353 fa.write(f"#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
354 else:
355 fa.write(f"\n#define GPS_REFRESH_RATE {gpsRateVar.get()}\n")
356 else:
357 f.write("\n#define A_GPS_IS_CONNECTED NO\n")
359 if imuExist.get() == "On":
360 f.write("\n#define A_MPU6050_IS_CONNECTED YES\n")
361 fa.write(f"\n#define PIN_INT_6050 {str(imuPinVar.get())}\n")
362 if imuDisplayOffset.get() == "On":
363 fa.write("\n#define DISPLAY_ACC_OFFSET\n")
364 fa.write("#define ACC_OFFSET_X 0\n")
365 fa.write("#define ACC_OFFSET_Y 0\n")
366 fa.write("#define ACC_OFFSET_Z 0\n")
367 else:
369 fa.write(f"#define ACC_OFFSET_X {str(imuOffsetXVar.get())}\n")
370 fa.write(f"#define ACC_OFFSET_Y {str(imuOffsetYVar.get())}\n")
371 fa.write(f"#define ACC_OFFSET_Z {str(imuOffsetZVar.get())}\n")
372 else:
373 f.write("\n#define A_MPU6050_IS_CONNECTED NO\n")
375 if magnetExist.get() == "On":
376 if GeneratemagCalData.get() == "On":
377 fa.write("\n#define GENERATE_MAG_CALIBRATION_DATA\n")
378 fa.write("#define XMAG_OFFSET 0\n")
379 fa.write("#define YMAG_OFFSET 0\n")
380 fa.write("#define ZMAG_OFFSET 0\n")
381 fa.write("#define XXMAG_CORRECTION 1\n")
382 fa.write("#define XYMAG_CORRECTION 0\n")
383 fa.write("#define XZMAG_CORRECTION 0\n")
384 fa.write("#define YXMAG_CORRECTION 0\n")
385 fa.write("#define YYMAG_CORRECTION 1\n")
386 fa.write("#define YZMAG_CORRECTION 0\n")
387 fa.write("#define ZXMAG_CORRECTION 0\n")
388 fa.write("#define ZYMAG_CORRECTION 0\n")
389 fa.write("#define ZZMAG_CORRECTION 1\n")
390 else:
391 fa.write(f"#define XMAG_OFFSET {str(xMagOffsetVar.get())}\n")
392 fa.write(f"#define YMAG_OFFSET {str(yMagOffsetVar.get())}\n")
393 fa.write(f"#define ZMAG_OFFSET {str(zMagOffsetVar.get())}\n")
394 fa.write(f"#define XXMAG_CORRECTION {str(xxMagCorrectionVar.get())}\n")
395 fa.write(f"#define XYMAG_CORRECTION {str(xyMagCorrectionVar.get())}\n")
396 fa.write(f"#define XZMAG_CORRECTION {str(xzMagCorrectionVar.get())}\n")
397 fa.write(f"#define YXMAG_CORRECTION {str(yxMagCorrectionVar.get())}\n")
398 fa.write(f"#define YYMAG_CORRECTION {str(yyMagCorrectionVar.get())}\n")
399 fa.write(f"#define YZMAG_CORRECTION {str(yzMagCorrectionVar.get())}\n")
400 fa.write(f"#define ZXMAG_CORRECTION {str(zxMagCorrectionVar.get())}\n")
401 fa.write(f"#define ZYMAG_CORRECTION {str(zyMagCorrectionVar.get())}\n")
402 fa.write(f"#define ZZMAG_CORRECTION {str(zzMagCorrectionVar.get())}\n")
403 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 YES\n")
405 else:
406 f.write("\n#define CALCULATE_YAW_WITH_HMC5883 NO\n")
408 if flowExist.get() == "On":
409 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED YES\n")
410 fa.write(f"#define PULSES_PER_ML {str(flowPulsesmlVar.get())}\n")
411 fa.write(f"#define TANK_CAPACITY {str(flowTankCapVar.get())}\n")
412 fa.write(f"#define INIT_FLOW_PARAM {str(flowL1ValueVar.get())} , {str(flowL2ValueVar.get())} , {str(flowL3ValueVar.get())} , {str(flowL4ValueVar.get())} , {str(flowL1CorrVar.get())} , {str(flowL2CorrVar.get())} , {str(flowL3CorrVar.get())} , {str(flowL4CorrVar.get())}\n")
413 fa.write(f"##define FLOW_SENSOR_RESET_AT_PPM {str(flowPPMResetVar.get())}\n")
414 else:
415 f.write("\n#define A_FLOW_SENSOR_IS_CONNECTED NO\n")
417 if sequenceExist.get() == 'On':
418 if SeqOut1Var.get()=='1' or SeqOut2Var.get()=='1' or SeqOut3Var.get()=='1' or SeqOut4Var.get()=='1' or SeqOut5Var.get()=='1' or SeqOut6Var.get()=='1':
419 fa.write(f"#define SEQUENCE_OUTPUTS 0b{SeqOut6Var.get()}{SeqOut5Var.get()}{SeqOut4Var.get()}{SeqOut3Var.get()}{SeqOut2Var.get()}{SeqOut1Var.get()}\n")
420 fa.write(f"#define SEQUENCE_UNIT {str(SeqUnitVar.get())}\n")
421 if SeqTVar[0].get()!='0' and SeqTVar[0].get()!='':
422 fa.write("#define SEQUENCE_m100 ")
423 for y in range (0,25):
424 if SeqTVar[y*4].get()=='':
425 break
426 if y!=0:
427 fa.write(",")
428 fa.write(f"{SeqTVar[y*4].get()}, 0b{str(SeqB5Var[y*4].get())}{str(SeqB4Var[y*4].get())}{str(SeqB3Var[y*4].get())}{str(SeqB2Var[y*4].get())}{str(SeqB1Var[y*4].get())}{str(SeqB0Var[y*4].get())}")
429 fa.write("\n")
430 if SeqTVar[1].get()!='0' and SeqTVar[1].get()!='':
431 fa.write("#define SEQUENCE_0 ")
432 for y in range (0,25):
433 if SeqTVar[y*4+1].get()=='':
434 break
435 if y!=0:
436 fa.write(",")
437 fa.write(f"{SeqTVar[y*4+1].get()}, 0b{str(SeqB5Var[y*4+1].get())}{str(SeqB4Var[y*4+1].get())}{str(SeqB3Var[y*4+1].get())}{str(SeqB2Var[y*4+1].get())}{str(SeqB1Var[y*4+1].get())}{str(SeqB0Var[y*4+1].get())}")
438 fa.write("\n")
439 if SeqTVar[2].get()!='0' and SeqTVar[2].get()!='':
440 fa.write("#define SEQUENCE_100 ")
441 for y in range (0,25):
442 if SeqTVar[y*4+2].get()=='':
443 break
444 if y!=0:
445 fa.write(",")
446 fa.write(f"{SeqTVar[y*4+2].get()}, 0b{str(SeqB5Var[y*4+2].get())}{str(SeqB4Var[y*4+2].get())}{str(SeqB3Var[y*4+2].get())}{str(SeqB2Var[y*4+2].get())}{str(SeqB1Var[y*4+2].get())}{str(SeqB0Var[y*4+2].get())}")
447 fa.write("\n")
448 if voltageExist.get() == "On":
449 if SeqTVar[3].get()!='0' and SeqTVar[3].get()!='' and (SeqMinVoltVar.get()!=0 or SeqMinCellVar.get()!=0):
450 fa.write("#define SEQUENCE_LOW ")
451 for y in range (0,25):
452 if SeqTVar[y*4+3].get()=='':
453 break
454 if y!=0:
455 fa.write(",")
456 fa.write(f"{SeqTVar[y*4+3].get()}, 0b{str(SeqB5Var[y*4+3].get())}{str(SeqB4Var[y*4+3].get())}{str(SeqB3Var[y*4+3].get())}{str(SeqB2Var[y*4+3].get())}{str(SeqB1Var[y*4+3].get())}{str(SeqB0Var[y*4+3].get())}")
457 fa.write("\n")
458 if (SeqMinVoltVar.get()!=0):
459 fa.write(f"#define SEQUENCE_MIN_VOLT_1 {str(SeqMinVoltVar.get())}")
460 messagebox.showinfo("oXs configurator", "Be carefull you may need to modify oXs_config_advanced.h to set the voltage source for sequence")
461 if (SeqMinCellVar.get()!=0):
462 fa.write(f"#define SEQUENCE_MIN_CELL {str(SeqMinCellVar.get())}")
463 if locatorExist.get() == "On":
464 f.write("\n#define A_LOCATOR_IS_CONNECTED YES\n")
465 else:
466 f.write("\n#define A_LOCATOR_IS_CONNECTED NO\n")
470 f.write("\n#endif\n")
471 fa.write("\n#endif\n")
472 f.close()
473 fa.close()
474 messagebox.showinfo("oXs configurator", "Config files advanced and basic have been created")
476 def uploadConfig():
477 from oxsVoltage import voltReferenceChanged
478 print("Read config")
479 #global configUploadFileName
480 #configUploadFileName = filedialog.askopenfilename(initialdir="C:/Data/",
481 configUploadFileName = filedialog.askopenfilename(\
482 filetypes =(("Ini files", "*.ini"),("All files","*.*")),
483 title = "Choose a file."
485 #config.read('config.ini')
486 config.read(configUploadFileName)
487 ppmExist.set(value= config.get('Main', 'ppmExist'))
488 ppmChanged()
489 varioExist.set(value= config.get('Main', 'varioExist'))
490 varioChanged()
491 voltageExist.set(value = config.get("Main", "voltageExist"))
492 voltageChanged()
493 currentExist.set(value = config.get("Main", "currentExist"))
494 currentChanged()
495 gpsExist.set(value = config.get("Main", "gpsExist"))
496 gpsChanged()
497 airspeedExist.set(value= config.get("Main", "airspeedExist"))
498 airspeedChanged()
499 rpmExist.set(value= config.get("Main", "rpmExist"))
500 rpmChanged()
501 imuExist.set(value= config.get("Main", "imuExist"))
502 imuChanged()
503 magnetExist.set(value= config.get("Main", "magnetExist"))
504 magnetChanged()
505 flowExist.set(value= config.get("Main", "flowExist"))
506 flowChanged()
507 adcExist.set(value= config.get("Main", "adcExist"))
508 adcChanged()
509 sequenceExist.set(value= config.get("Main", "sequenceExist"))
510 sequenceChanged()
511 persistentExist.set(value= config.get("Main", "persistentExist"))
512 persistentChanged()
513 addFieldsExist.set(value= config.get("Main", "addFieldsExist"))
514 addFieldsChanged()
515 protocolVar.set(value= config.get("Main", "protocolVar"))
516 protocolChanged()
518 ppmTypeVar.set(value= config.get("Ppm", "ppmTypeVar"))
519 ppmTypeChanged()
520 ppmPinVar.set(value= config.getint("Ppm", "ppmPinVar"))
521 ppmForMin100Var.set(value= config.getint("Ppm", "ppmForMin100Var"))
522 ppmForPlus100Var.set(value= config.getint("Ppm", "ppmForPlus100Var"))
524 imuPinVar.set(value= config.getint("Imu", "imuPinVar"))
525 imuDisplayOffset.set(value= config.get("Imu", "imuDisplayOffset"))
526 imuOffsetXVar.set(value= config.getint("Imu", "imuOffsetXVar"))
527 imuOffsetYVar.set(value= config.getint("Imu", "imuOffsetYVar"))
528 imuOffsetZVar.set(value= config.getint("Imu", "imuOffsetZVar"))
530 GeneratemagCalData.set(value= config.get("Magnet", "GeneratemagCalData"))
531 xMagOffsetVar.set(value= config.getint("Magnet", "xMagOffsetVar"))
532 yMagOffsetVar.set(value= config.getint("Magnet", "yMagOffsetVar"))
533 zMagOffsetVar.set(value= config.getint("Magnet", "zMagOffsetVar"))
534 xxMagCorrectionVar.set(value= config.getfloat("Magnet", "xxMagCorrectionVar"))
535 xyMagCorrectionVar.set(value= config.getfloat("Magnet", "xyMagCorrectionVar"))
536 xzMagCorrectionVar.set(value= config.getfloat("Magnet", "xzMagCorrectionVar"))
537 yxMagCorrectionVar.set(value= config.getfloat("Magnet", "yxMagCorrectionVar"))
538 yyMagCorrectionVar.set(value= config.getfloat("Magnet", "yyMagCorrectionVar"))
539 yzMagCorrectionVar.set(value= config.getfloat("Magnet", "yzMagCorrectionVar"))
540 zxMagCorrectionVar.set(value= config.getfloat("Magnet", "zxMagCorrectionVar"))
541 zyMagCorrectionVar.set(value= config.getfloat("Magnet", "zyMagCorrectionVar"))
542 zzMagCorrectionVar.set(value= config.getfloat("Magnet", "zzMagCorrectionVar"))
544 pushButtPinVar.set(value= config.getint("Memory", "pushButtPinVar"))
546 varioTypeVar.set(value= config.get("Vario", "varioTypeVar"))
547 secondBaroExist.set(value= config.get("Vario", "secondBaroExist"))
548 varioSourceVar.set(value= config.get("Vario", "varioSourceVar"))
549 varioHysteresisVar.set(value= config.getint("Vario", "varioHysteresisVar"))
550 analogVarioExist.set(value= config.get("Vario", "analogVarioExist"))
551 analogVarioChanged()
552 varioAnalogPinVar.set(value= config.get("Vario", "varioAnalogPinVar"))
553 varioAnalogMinVar.set(value= config.getfloat("Vario", "varioAnalogMinVar"))
554 varioAnalogMaxVar.set(value= config.getfloat("Vario", "varioAnalogMaxVar"))
556 airspeedTypeVar.set(value= config.get("Airspeed", "airspeedTypeVar"))
557 airspeedAtSea15CVar.set(value= config.get("Airspeed", "airspeedAtSea15CVar"))
558 airspeedInKmhVar.set(value= config.get("Airspeed", "airspeedInKmhVar"))
559 airspeedResetAtPpmVar.set(value= config.getint("Airspeed", "airspeedResetAtPpmVar"))
560 airspeedCompMinAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMinAtPpmVar"))
561 airspeedCompMaxAtPpmVar.set(value= config.getint("Airspeed", "airspeedCompMaxAtPpmVar"))
562 airspeedCompMinVar.set(value= config.getint("Airspeed", "airspeedCompMinVar"))
563 airspeedCompMaxVar.set(value= config.getint("Airspeed", "airspeedCompMaxVar"))
565 volt1Exist.set(value= config.get("Voltage", "volt1Exist"))
566 volt2Exist.set(value= config.get("Voltage", "volt2Exist"))
567 volt3Exist.set(value= config.get("Voltage", "volt3Exist"))
568 volt4Exist.set(value= config.get("Voltage", "volt4Exist"))
569 volt5Exist.set(value= config.get("Voltage", "volt5Exist"))
570 volt6Exist.set(value= config.get("Voltage", "volt6Exist"))
571 volt1PinVar.set(value= config.get("Voltage", "volt1PinVar"))
572 volt2PinVar.set(value= config.get("Voltage", "volt2PinVar"))
573 volt3PinVar.set(value= config.get("Voltage", "volt3PinVar"))
574 volt4PinVar.set(value= config.get("Voltage", "volt4PinVar"))
575 volt5PinVar.set(value= config.get("Voltage", "volt5PinVar"))
576 volt6PinVar.set(value= config.get("Voltage", "volt6PinVar"))
577 volt1RgVar.set(value= config.getfloat("Voltage", "volt1RgVar"))
578 volt2RgVar.set(value= config.getfloat("Voltage", "volt2RgVar"))
579 volt3RgVar.set(value= config.getfloat("Voltage", "volt3RgVar"))
580 volt4RgVar.set(value= config.getfloat("Voltage", "volt4RgVar"))
581 volt5RgVar.set(value= config.getfloat("Voltage", "volt5RgVar"))
582 volt6RgVar.set(value= config.getfloat("Voltage", "volt6RgVar"))
583 volt1RvVar.set(value= config.getfloat("Voltage", "volt1RvVar"))
584 volt2RvVar.set(value= config.getfloat("Voltage", "volt2RvVar"))
585 volt3RvVar.set(value= config.getfloat("Voltage", "volt3RvVar"))
586 volt4RvVar.set(value= config.getfloat("Voltage", "volt4RvVar"))
587 volt5RvVar.set(value= config.getfloat("Voltage", "volt5RvVar"))
588 volt6RvVar.set(value= config.getfloat("Voltage", "volt6RvVar"))
589 volt1ScaleVar.set(value= config.getfloat("Voltage", "volt1ScaleVar"))
590 volt2ScaleVar.set(value= config.getfloat("Voltage", "volt2ScaleVar"))
591 volt3ScaleVar.set(value= config.getfloat("Voltage", "volt3ScaleVar"))
592 volt4ScaleVar.set(value= config.getfloat("Voltage", "volt4ScaleVar"))
593 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt5ScaleVar"))
594 volt5ScaleVar.set(value= config.getfloat("Voltage", "volt6ScaleVar"))
595 volt1OffsetVar.set(value= config.getfloat("Voltage", "volt1OffsetVar"))
596 volt2OffsetVar.set(value= config.getfloat("Voltage", "volt2OffsetVar"))
597 volt3OffsetVar.set(value= config.getfloat("Voltage", "volt3OffsetVar"))
598 volt4OffsetVar.set(value= config.getfloat("Voltage", "volt4OffsetVar"))
599 volt5OffsetVar.set(value= config.getfloat("Voltage", "volt5OffsetVar"))
600 volt6OffsetVar.set(value= config.getfloat("Voltage", "volt6OffsetVar"))
601 voltReferenceVar.set(value= config.get("Voltage", "voltReferenceVar"))
602 voltRefValueVar.set(value= config.getfloat("Voltage", "voltRefValueVar"))
603 voltReferenceChanged()
606 currentPinVar.set(value= config.get("Current", "currentPinVar"))
607 currentMvoltAt0Var.set(value= config.getfloat("Current", "currentMvoltAt0Var"))
608 currentMvoltPerAmpVar.set(value= config.getfloat("Current", "currentMvoltPerAmpVar"))
609 currentRgVar.set(value= config.getfloat("Current", "currentRgVar"))
610 currentRcVar.set(value= config.getfloat("Current", "currentRcVar"))
612 flowPulsesmlVar.set(value= config.getint("Flow", "flowPulsesmlVar"))
613 flowTankCapVar.set(value= config.getint("Flow", "flowTankCapVar"))
614 flowL1ValueVar.set(value= config.getint("Flow", "flowL1ValueVar"))
615 flowL1CorrVar.set(value= config.getint("Flow", "flowL1CorrVar"))
616 flowL2ValueVar.set(value= config.getint("Flow", "flowL2ValueVar"))
617 flowL2CorrVar.set(value= config.getint("Flow", "flowL2CorrVar"))
618 flowL3ValueVar.set(value= config.getint("Flow", "flowL3ValueVar"))
619 flowL3CorrVar.set(value= config.getint("Flow", "flowL3CorrVar"))
620 flowL4ValueVar.set(value= config.getint("Flow", "flowL4ValueVar"))
621 flowL4CorrVar.set(value= config.getint("Flow", "flowL4CorrVar"))
622 flowPPMResetVar.set(value= config.getint("Flow", "flowPPMResetVar"))
624 pulsesPerRotationVar.set(value=config.get("Rpm","pulsesPerRotationVar"))
626 Adc0TypeVar.set(value= config.get("Ads", "Adc0TypeVar"))
627 Adc1TypeVar.set(value= config.get("Ads", "Adc1TypeVar"))
628 Adc2TypeVar.set(value= config.get("Ads", "Adc2TypeVar"))
629 Adc3TypeVar.set(value= config.get("Ads", "Adc3TypeVar"))
630 Adc0FsVar.set(value= config.get("Ads", "Adc0FsVar"))
631 Adc1FsVar.set(value= config.get("Ads", "Adc1FsVar"))
632 Adc2FsVar.set(value= config.get("Ads", "Adc2FsVar"))
633 Adc3FsVar.set(value= config.get("Ads", "Adc3FsVar"))
634 Adc0OffVar.set(value= config.getint("Ads", "Adc0OffVar"))
635 Adc1OffVar.set(value= config.getint("Ads", "Adc1OffVar"))
636 Adc2OffVar.set(value= config.getint("Ads", "Adc2OffVar"))
637 Adc3OffVar.set(value= config.getint("Ads", "Adc3OffVar"))
638 Adc0ScVar.set(value= config.getfloat("Ads", "Adc0ScVar"))
639 Adc1ScVar.set(value= config.getfloat("Ads", "Adc1ScVar"))
640 Adc2ScVar.set(value= config.getfloat("Ads", "Adc2ScVar"))
641 Adc3ScVar.set(value= config.getfloat("Ads", "Adc3ScVar"))
642 Adc0CrVar.set(value= config.get("Ads", "Adc0CrVar"))
643 Adc1CrVar.set(value= config.get("Ads", "Adc1CrVar"))
644 Adc2CrVar.set(value= config.get("Ads", "Adc2CrVar"))
645 Adc3CrVar.set(value= config.get("Ads", "Adc3CrVar"))
646 Adc0AvgVar.set(value= config.getint("Ads", "Adc0AvgVar"))
647 Adc1AvgVar.set(value= config.getint("Ads", "Adc1AvgVar"))
648 Adc2AvgVar.set(value= config.getint("Ads", "Adc2AvgVar"))
649 Adc3AvgVar.set(value= config.getint("Ads", "Adc3AvgVar"))
650 AdcCurrVar.set(value= config.get("Ads", "AdcCurrVar"))
651 AdcSpVar.set(value= config.get("Ads", "AdcSpVar"))
653 gps3dExist.set(value= config.get("Gps", "gps3dexist"))
654 gpsTimeExist.set(value= config.get("Gps", "gpstimeexist"))
655 gpsRateVar.set(value= config.getint("Gps", "gpsratevar"))
656 fillTest1VarioTemperatureVar.set(value= config.get("AddFields", "fillTest1VarioTemperatureVar"))
657 fillTest2VarioTemperatureVar.set(value= config.get("AddFields", "fillTest2VarioTemperatureVar"))
658 fillTest3VarioTemperatureVar.set(value= config.get("AddFields", "fillTest3VarioTemperatureVar"))
659 fillTest3ExpectedAltitudeVar.set(value= config.get("AddFields", "fillTest3ExpectedAltitudeVar"))
660 fillTest3ExpectedAltitudeChanged()
661 expAltTimeVar.set(value= config.getfloat("AddFields", "expAltTimeVar"))
662 fillTest123LinearAccVar.set(value= config.get("AddFields", "fillTest123LinearAccVar"))
663 fillTest12VspeedAltVar.set(value= config.get("AddFields", "fillTest12VspeedAltVar"))
664 fillTest1DteVar.set(value= config.get("AddFields", "fillTest1DteVar"))
665 fillTest2PpmAirspeedCompVar.set(value= config.get("AddFields", "fillTest2PpmAirspeedCompVar"))
666 fillTest1YawRateVar.set(value= config.get("AddFields", "fillTest1YawRateVar"))
667 fillTest1HeadingVar.set(value= config.get("AddFields", "fillTest1HeadingVar"))
668 fillTest123FlowVar.set(value= config.get("AddFields", "fillTest123FlowVar"))
669 fillTest1GpsNbrSatVar.set(value= config.get("AddFields", "fillTest1GpsNbrSatVar"))
670 fillTest2GpsHdopVar.set(value= config.get("AddFields", "fillTest2GpsHdopVar"))
672 frskyVfasVar.set(value= config.get("Frsky", "frskyVfasVar"))
673 frskyFuelVar.set(value= config.get("Frsky", "frskyFuelVar"))
674 frskyA3Var.set(value= config.get("Frsky", "frskyA3Var"))
675 frskyA4Var.set(value= config.get("Frsky", "frskyA4Var"))
676 frskyAccxVar.set(value= config.get("Frsky", "frskyAccxVar"))
677 frskyAccyVar.set(value= config.get("Frsky", "frskyAccyVar"))
678 frskyAcczVar.set(value= config.get("Frsky", "frskyAcczVar"))
679 frskyT1Var.set(value= config.get("Frsky", "frskyT1Var"))
680 frskyT2Var.set(value= config.get("Frsky", "frskyT2Var"))
682 multiplexLine1Var.set(value= config.get("Multiplex", "multiplexLine1Var"))
683 multiplexLine2Var.set(value= config.get("Multiplex", "multiplexLine2Var"))
684 multiplexLine3Var.set(value= config.get("Multiplex", "multiplexLine3Var"))
685 multiplexLine4Var.set(value= config.get("Multiplex", "multiplexLine4Var"))
686 multiplexLine5Var.set(value= config.get("Multiplex", "multiplexLine5Var"))
687 multiplexLine6Var.set(value= config.get("Multiplex", "multiplexLine6Var"))
688 multiplexLine7Var.set(value= config.get("Multiplex", "multiplexLine7Var"))
689 multiplexLine8Var.set(value= config.get("Multiplex", "multiplexLine8Var"))
690 multiplexLine9Var.set(value= config.get("Multiplex", "multiplexLine9Var"))
692 hottBattery1SourceVar.set(value= config.get("Hott", "hottBattery1SourceVar"))
693 hottBattery2SourceVar.set(value= config.get("Hott", "hottBattery2SourceVar"))
694 hottCellUndervoltageVar.set(value= config.getint("Hott", "hottCellUndervoltageVar"))
695 hottMainBatterySourceVar.set(value= config.get("Hott", "hottMainBatterySourceVar"))
696 hottT1SourceVar.set(value= config.get("Hott", "hottT1SourceVar"))
697 hottT2SourceVar.set(value= config.get("Hott", "hottT2SourceVar"))
699 jetiVoltageSourceVar.set(value= config.get("Jeti", "jetiVoltageSourceVar"))
700 jetiTemperatureSourceVar.set(value= config.get("Jeti", "jetiTemperatureSourceVar"))
702 def saveConfig():
703 config.set("Main", "ppmExist", ppmExist.get())
704 config.set("Main", "varioExist", varioExist.get())
705 config.set("Main", "voltageExist", voltageExist.get())
706 config.set("Main", "currentExist", currentExist.get())
707 config.set("Main", "gpsExist", gpsExist.get())
708 config.set("Main", "airspeedExist", airspeedExist.get())
709 config.set("Main", "rpmExist", rpmExist.get())
710 config.set("Main", "imuExist", imuExist.get())
711 config.set("Main", "magnetExist", magnetExist.get())
712 config.set("Main", "flowExist", flowExist.get())
713 config.set("Main", "adcExist", adcExist.get())
714 config.set("Main", "sequenceExist", sequenceExist.get())
715 config.set("Main", "persistentExist", persistentExist.get())
717 config.set("Main", "addFieldsExist", addFieldsExist.get())
718 config.set("Main", "protocolVar", protocolVar.get())
720 config.set("Ppm", "ppmTypeVar", ppmTypeVar.get())
721 config.set("Ppm", "ppmPinVar", str(ppmPinVar.get()))
722 config.set("Ppm", "ppmForMin100Var", str(ppmForMin100Var.get()))
723 config.set("Ppm", "ppmForPlus100Var", str(ppmForPlus100Var.get()))
725 config.set("Imu", "imuPinVar", str(imuPinVar.get()))
726 config.set("Imu", "imuDisplayOffset", imuDisplayOffset.get())
727 config.set("Imu", "imuOffsetXVar", str(imuOffsetXVar.get()))
728 config.set("Imu", "imuOffsetYVar", str(imuOffsetYVar.get()))
729 config.set("Imu", "imuOffsetZVar", str(imuOffsetZVar.get()))
731 config.set("Magnet", "GeneratemagCalData", GeneratemagCalData.get())
732 config.set("Magnet", "xMagOffsetVar", str(xMagOffsetVar.get()))
733 config.set("Magnet", "yMagOffsetVar", str(yMagOffsetVar.get()))
734 config.set("Magnet", "zMagOffsetVar", str(zMagOffsetVar.get()))
735 config.set("Magnet", "xxMagCorrectionVar", str(xxMagCorrectionVar.get()))
736 config.set("Magnet", "xyMagCorrectionVar", str(xyMagCorrectionVar.get()))
737 config.set("Magnet", "xzMagCorrectionVar", str(xzMagCorrectionVar.get()))
738 config.set("Magnet", "yxMagCorrectionVar", str(xxMagCorrectionVar.get()))
739 config.set("Magnet", "yyMagCorrectionVar", str(yyMagCorrectionVar.get()))
740 config.set("Magnet", "yzMagCorrectionVar", str(yzMagCorrectionVar.get()))
741 config.set("Magnet", "zxMagCorrectionVar", str(zxMagCorrectionVar.get()))
742 config.set("Magnet", "zyMagCorrectionVar", str(zyMagCorrectionVar.get()))
743 config.set("Magnet", "zzMagCorrectionVar", str(zzMagCorrectionVar.get()))
745 config.set("Memory", "pushButtPinVar", str(pushButtPinVar.get()))
747 config.set("Vario", "varioTypeVar", varioTypeVar.get())
748 config.set("Vario", "secondBaroExist", secondBaroExist.get())
749 config.set("Vario", "varioSourceVar", varioSourceVar.get())
750 config.set("Vario", "varioHysteresisVar", str(varioHysteresisVar.get()))
751 config.set("Vario", "analogVarioExist", analogVarioExist.get())
752 config.set("Vario", "varioAnalogPinVar", varioAnalogPinVar.get())
753 config.set("Vario", "varioAnalogMinVar", str(varioAnalogMinVar.get()))
754 config.set("Vario", "varioAnalogMaxVar", str(varioAnalogMaxVar.get()))
756 config.set("Airspeed", "airspeedTypeVar", airspeedTypeVar.get())
757 config.set("Airspeed", "airspeedAtSea15CVar", airspeedAtSea15CVar.get())
758 config.set("Airspeed", "airspeedInKmhVar", airspeedInKmhVar.get())
759 config.set("Airspeed", "airspeedResetAtPpmVar", str(airspeedResetAtPpmVar.get()))
760 config.set("Airspeed", "airspeedCompMinAtPpmVar", str(airspeedCompMinAtPpmVar.get()))
761 config.set("Airspeed", "airspeedCompMaxAtPpmVar", str(airspeedCompMaxAtPpmVar.get()))
762 config.set("Airspeed", "airspeedCompMinVar", str(airspeedCompMinVar.get()))
763 config.set("Airspeed", "airspeedCompMaxVar", str(airspeedCompMaxVar.get()))
765 config.set("Voltage", "volt1Exist", volt1Exist.get())
766 config.set("Voltage", "volt2Exist", volt2Exist.get())
767 config.set("Voltage", "volt3Exist", volt3Exist.get())
768 config.set("Voltage", "volt4Exist", volt4Exist.get())
769 config.set("Voltage", "volt5Exist", volt5Exist.get())
770 config.set("Voltage", "volt6Exist", volt6Exist.get())
771 config.set("Voltage", "volt1PinVar", volt1PinVar.get())
772 config.set("Voltage", "volt2PinVar", volt2PinVar.get())
773 config.set("Voltage", "volt3PinVar", volt3PinVar.get())
774 config.set("Voltage", "volt4PinVar", volt4PinVar.get())
775 config.set("Voltage", "volt5PinVar", volt5PinVar.get())
776 config.set("Voltage", "volt6PinVar", volt6PinVar.get())
777 config.set("Voltage", "volt1RgVar", str(volt1RgVar.get()))
778 config.set("Voltage", "volt2RgVar", str(volt2RgVar.get()))
779 config.set("Voltage", "volt3RgVar", str(volt3RgVar.get()))
780 config.set("Voltage", "volt4RgVar", str(volt4RgVar.get()))
781 config.set("Voltage", "volt5RgVar", str(volt5RgVar.get()))
782 config.set("Voltage", "volt6RgVar", str(volt6RgVar.get()))
783 config.set("Voltage", "volt1RvVar", str(volt1RvVar.get()))
784 config.set("Voltage", "volt2RvVar", str(volt2RvVar.get()))
785 config.set("Voltage", "volt3RvVar", str(volt3RvVar.get()))
786 config.set("Voltage", "volt4RvVar", str(volt4RvVar.get()))
787 config.set("Voltage", "volt5RvVar", str(volt5RvVar.get()))
788 config.set("Voltage", "volt6RvVar", str(volt6RvVar.get()))
789 config.set("Voltage", "volt1ScaleVar", str(volt1ScaleVar.get()))
790 config.set("Voltage", "volt2ScaleVar", str(volt2ScaleVar.get()))
791 config.set("Voltage", "volt3ScaleVar", str(volt3ScaleVar.get()))
792 config.set("Voltage", "volt4ScaleVar", str(volt4ScaleVar.get()))
793 config.set("Voltage", "volt5ScaleVar", str(volt5ScaleVar.get()))
794 config.set("Voltage", "volt6ScaleVar", str(volt6ScaleVar.get()))
795 config.set("Voltage", "volt1OffsetVar", str(volt1OffsetVar.get()))
796 config.set("Voltage", "volt2OffsetVar", str(volt2OffsetVar.get()))
797 config.set("Voltage", "volt3OffsetVar", str(volt3OffsetVar.get()))
798 config.set("Voltage", "volt4OffsetVar", str(volt4OffsetVar.get()))
799 config.set("Voltage", "volt5OffsetVar", str(volt5OffsetVar.get()))
800 config.set("Voltage", "volt6OffsetVar", str(volt6OffsetVar.get()))
801 config.set("Voltage", "voltReferenceVar", voltReferenceVar.get())
802 config.set("Voltage", "voltRefValueVar", str(voltRefValueVar.get()))
804 config.set("Current", "currentPinVar", currentPinVar.get())
805 config.set("Current", "currentMvoltAt0Var", str(currentMvoltAt0Var.get()))
806 config.set("Current", "currentMvoltPerAmpVar", str(currentMvoltPerAmpVar.get()))
807 config.set("Current", "currentRgVar", str(currentRgVar.get()))
808 config.set("Current", "currentRcVar", str(currentRcVar.get()))
810 config.set("Flow", "flowPulsesmlVar", str(flowPulsesmlVar.get()))
811 config.set("Flow", "flowTankCapVar", str(flowTankCapVar.get()))
812 config.set("Flow", "flowL1ValueVar", str(flowL1ValueVar.get()))
813 config.set("Flow", "flowL1CorrVar", str(flowL1CorrVar.get()))
814 config.set("Flow", "flowL2ValueVar", str(flowL2ValueVar.get()))
815 config.set("Flow", "flowL2CorrVar", str(flowL2CorrVar.get()))
816 config.set("Flow", "flowL3ValueVar", str(flowL3ValueVar.get()))
817 config.set("Flow", "flowL3CorrVar", str(flowL3CorrVar.get()))
818 config.set("Flow", "flowL4ValueVar", str(flowL4ValueVar.get()))
819 config.set("Flow", "flowL4CorrVar", str(flowL4CorrVar.get()))
820 config.set("Flow", "flowPPMResetVar", str(flowPPMResetVar.get()))
822 config.set("Rpm", "pulsesPerRotationVar", str(pulsesPerRotationVar.get()))
824 config.set("Ads", "Adc0TypeVar", Adc0TypeVar.get())
825 config.set("Ads", "Adc1TypeVar", Adc1TypeVar.get())
826 config.set("Ads", "Adc2TypeVar", Adc2TypeVar.get())
827 config.set("Ads", "Adc3TypeVar", Adc3TypeVar.get())
828 config.set("Ads", "Adc0FsVar", Adc0FsVar.get())
829 config.set("Ads", "Adc1FsVar", Adc1FsVar.get())
830 config.set("Ads", "Adc2FsVar", Adc2FsVar.get())
831 config.set("Ads", "Adc3FsVar", Adc3FsVar.get())
832 config.set("Ads", "Adc0OffVar", str(Adc0OffVar.get()))
833 config.set("Ads", "Adc1OffVar", str(Adc1OffVar.get()))
834 config.set("Ads", "Adc2OffVar", str(Adc2OffVar.get()))
835 config.set("Ads", "Adc3OffVar", str(Adc3OffVar.get()))
836 config.set("Ads", "Adc0ScVar", str(Adc0ScVar.get()))
837 config.set("Ads", "Adc1ScVar", str(Adc1ScVar.get()))
838 config.set("Ads", "Adc2ScVar", str(Adc2ScVar.get()))
839 config.set("Ads", "Adc3ScVar", str(Adc3ScVar.get()))
840 config.set("Ads", "Adc0CrVar", Adc0CrVar.get())
841 config.set("Ads", "Adc1CrVar", Adc1CrVar.get())
842 config.set("Ads", "Adc2CrVar", Adc2CrVar.get())
843 config.set("Ads", "Adc3CrVar", Adc3CrVar.get())
844 config.set("Ads", "Adc0AvgVar", str(Adc0AvgVar.get()))
845 config.set("Ads", "Adc1AvgVar", str(Adc1AvgVar.get()))
846 config.set("Ads", "Adc2AvgVar", str(Adc2AvgVar.get()))
847 config.set("Ads", "Adc3AvgVar", str(Adc3AvgVar.get()))
848 config.set("Ads", "AdcCurrVar", AdcCurrVar.get())
849 config.set("Ads", "AdcSpVar", AdcSpVar.get())
851 config.set("Gps", "gps3dExist", gps3dExist.get())
852 config.set("Gps", "gpsTimeExist", gpsTimeExist.get())
853 config.set("Gps", "gpsRateVar", gpsRateVar.get())
855 config.set("AddFields", "fillTest1VarioTemperatureVar", fillTest1VarioTemperatureVar.get())
856 config.set("AddFields", "fillTest2VarioTemperatureVar", fillTest2VarioTemperatureVar.get())
857 config.set("AddFields", "fillTest3VarioTemperatureVar", fillTest3VarioTemperatureVar.get())
858 config.set("AddFields", "fillTest3ExpectedAltitudeVar", fillTest3ExpectedAltitudeVar.get())
859 config.set("AddFields", "expAltTimeVar", str(expAltTimeVar.get()))
860 config.set("AddFields", "fillTest123LinearAccVar", fillTest123LinearAccVar.get())
861 config.set("AddFields", "fillTest12VspeedAltVar", fillTest12VspeedAltVar.get())
862 config.set("AddFields", "fillTest1DteVar", fillTest1DteVar.get())
863 config.set("AddFields", "fillTest2PpmAirspeedCompVar", fillTest2PpmAirspeedCompVar.get())
864 config.set("AddFields", "fillTest1YawRateVar", fillTest1YawRateVar.get())
865 config.set("AddFields", "fillTest1HeadingVar", fillTest1HeadingVar.get())
866 config.set("AddFields", "fillTest123FlowVar", fillTest123FlowVar.get())
867 config.set("AddFields", "fillTest1GpsNbrSatVar", fillTest1GpsNbrSatVar.get())
868 config.set("AddFields", "fillTest2GpsHdopVar", fillTest2GpsHdopVar.get())
870 config.set("Frsky", "frskyVfasVar", frskyVfasVar.get())
871 config.set("Frsky", "frskyFuelVar", frskyFuelVar.get())
872 config.set("Frsky", "frskyA3Var", frskyA3Var.get())
873 config.set("Frsky", "frskyA4Var", frskyA4Var.get())
874 config.set("Frsky", "frskyAccxVar", frskyAccxVar.get())
875 config.set("Frsky", "frskyAccyVar", frskyAccyVar.get())
876 config.set("Frsky", "frskyAcczVar", frskyAcczVar.get())
877 config.set("Frsky", "frskyT1Var", frskyT1Var.get())
878 config.set("Frsky", "frskyT2Var", frskyT2Var.get())
880 config.set("Multiplex", "multiplexLine1Var", multiplexLine1Var.get())
881 config.set("Multiplex", "multiplexLine2Var", multiplexLine2Var.get())
882 config.set("Multiplex", "multiplexLine3Var", multiplexLine3Var.get())
883 config.set("Multiplex", "multiplexLine4Var", multiplexLine4Var.get())
884 config.set("Multiplex", "multiplexLine5Var", multiplexLine5Var.get())
885 config.set("Multiplex", "multiplexLine6Var", multiplexLine6Var.get())
886 config.set("Multiplex", "multiplexLine7Var", multiplexLine7Var.get())
887 config.set("Multiplex", "multiplexLine8Var", multiplexLine8Var.get())
888 config.set("Multiplex", "multiplexLine9Var", multiplexLine9Var.get())
890 config.set("Hott", "hottBattery1SourceVar", hottBattery1SourceVar.get())
891 config.set("Hott", "hottBattery2SourceVar", hottBattery2SourceVar.get())
892 config.set("Hott", "hottCellUndervoltageVar", str(hottCellUndervoltageVar.get()))
893 config.set("Hott", "hottMainBatterySourceVar", hottMainBatterySourceVar.get())
894 config.set("Hott", "hottT1SourceVar", hottT1SourceVar.get())
895 config.set("Hott", "hottT2SourceVar", hottT2SourceVar.get())
897 config.set("Jeti", "jetiVoltageSourceVar", jetiVoltageSourceVar.get())
898 config.set("Jeti", "jetiTemperatureSourceVar", jetiTemperatureSourceVar.get())
900 configSaveFileName = filedialog.asksaveasfilename(title="Save as...", defaultextension="*.ini",\
901 filetypes=[("Ini files","*.ini"),("All files", "*")], initialfile=configUploadFileName)
902 print(configSaveFileName)
903 config.write(open(configSaveFileName ,'w'))
904 #configUploadFileName = configSaveFileName
905 #config.write(open('config.ini','w'))
907 def protocolChanged(*arg):
908 #print(protocolVar.get() )
909 nb.tab(16, state="hidden")
910 nb.tab(17, state="hidden")
911 nb.tab(18, state="hidden")
912 nb.tab(19, state="hidden")
913 if protocolVar.get() == "FRSKY_SPORT" or protocolVar.get() == "FRSKY_HUB" or protocolVar.get() == "FRSKY_SPORT_HUB" :
914 nb.tab(16, state="normal")
915 elif protocolVar.get() == "JETI":
916 nb.tab(17, state="normal")
917 elif protocolVar.get() == "HOTT":
918 nb.tab(18, state="normal")
919 elif protocolVar.get() == "MULTIPLEX":
920 nb.tab(19, state="normal")
922 def ppmChanged():
923 if ppmExist.get() == 'On':
924 nb.tab(1, state="normal")
925 else:
926 nb.tab(1, state="hidden")
927 def ppmTypeChanged(*arg):
928 if ppmTypeVar.get() == 'Rx chanel':
929 fPpmType.grid(row=8)
930 else:
931 fPpmType.grid_remove()
932 def varioChanged():
933 if varioExist.get() == 'On':
934 nb.tab(2, state="normal")
935 else:
936 nb.tab(2, state="hidden")
937 def voltageChanged():
938 if voltageExist.get() == 'On':
939 nb.tab(3, state="normal")
940 else:
941 nb.tab(3, state="hidden")
942 def currentChanged():
943 if currentExist.get() == 'On':
944 nb.tab(4, state="normal")
945 else:
946 nb.tab(4, state="hidden")
947 def gpsChanged():
948 if gpsExist.get() == 'On':
949 nb.tab(5, state="normal")
950 else:
951 nb.tab(5, state="hidden")
952 def airspeedChanged():
953 if airspeedExist.get() == 'On':
954 nb.tab(6, state="normal")
955 else:
956 nb.tab(6, state="hidden")
957 def rpmChanged():
958 if rpmExist.get() == 'On':
959 nb.tab(7, state="normal")
960 else:
961 nb.tab(7, state="hidden")
962 def imuChanged():
963 if imuExist.get() == 'On':
964 nb.tab(8, state="normal")
965 else:
966 nb.tab(8, state="hidden")
967 def magnetChanged():
968 if magnetExist.get() == 'On':
969 nb.tab(9, state="normal")
970 else:
971 nb.tab(9, state="hidden")
972 def flowChanged():
973 if flowExist.get() == 'On':
974 nb.tab(10, state="normal")
975 else:
976 nb.tab(10, state="hidden")
977 def adcChanged():
978 if adcExist.get() == 'On':
979 nb.tab(11, state="normal")
980 else:
981 nb.tab(11, state="hidden")
982 def locatorChanged():
983 if locatorExist.get() == 'On':
984 nb.tab(12, state="normal")
985 else:
986 nb.tab(12, state="hidden")
987 def sequenceChanged():
988 if sequenceExist.get() == 'On':
989 nb.tab(13, state="normal")
990 else:
991 nb.tab(13, state="hidden")
992 def persistentChanged():
993 if persistentExist.get() == 'On':
994 nb.tab(14, state="normal")
995 else:
996 nb.tab(14, state="hidden")
997 def addFieldsChanged():
998 if addFieldsExist.get() == 'On':
999 nb.tab(15, state="normal")
1000 else:
1001 nb.tab(15, state="hidden")
1003 def fillTest3ExpectedAltitudeChanged():
1004 if fillTest3ExpectedAltitudeVar.get() == 'On':
1005 fFillTest3ExpectedAltitude.grid(row=4)
1006 else:
1007 fFillTest3ExpectedAltitude.grid_remove()
1008 def analogVarioChanged():
1009 if analogVarioExist.get() == 'On':
1010 fAnalogVario.grid(row=8)
1011 else:
1012 fAnalogVario.grid_remove()
1015 root = Tk()
1016 root.title("openXsensor configurator V1.0.4")
1017 nb = ttk.Notebook(root)
1018 nb.enable_traversal()
1019 fMain = ttk.Frame(nb)
1020 fPpm = ttk.Frame(nb) # page 1
1021 fVario = ttk.Frame(nb) # page 2
1022 fVoltage = ttk.Frame(nb) # page 3
1023 fCurrent = ttk.Frame(nb) # page 4
1024 fGps = ttk.Frame(nb) # page 5
1025 fAirspeed = ttk.Frame(nb) # page 6
1026 fRpm = ttk.Frame(nb) # page 7
1027 fImu = ttk.Frame(nb) # page 8
1028 fMagnet = ttk.Frame(nb) # page 9
1029 fFlow = ttk.Frame(nb) # page 10
1030 fAdc = ttk.Frame(nb) # page 11
1031 fLocator = ttk.Frame(nb) # page 12
1032 fSequence = ttk.Frame(nb) # page 13
1033 fMemory = ttk.Frame(nb) # page 14
1034 fAddFields = ttk.Frame(nb) # page 15
1035 fFrsky = ttk.Frame(nb) # page 16
1036 fJeti = ttk.Frame(nb) # page 17
1037 fHott = ttk.Frame(nb) # page 18
1038 fMultiplex = ttk.Frame(nb) # page 19
1040 ppmExist = StringVar(value='Off')
1041 varioExist = StringVar(value='Off')
1042 voltageExist = StringVar(value='Off')
1043 currentExist = StringVar(value='Off')
1044 gpsExist = StringVar(value='Off')
1045 airspeedExist = StringVar(value='Off')
1046 rpmExist = StringVar(value='Off')
1047 imuExist = StringVar(value='Off')
1048 magnetExist = StringVar(value='Off')
1049 flowExist = StringVar(value='Off')
1050 locatorExist = StringVar(value='Off')
1051 persistentExist = StringVar(value='Off')
1052 adcExist = StringVar(value='Off')
1053 sequenceExist = StringVar(value='Off')
1054 addFieldsExist = StringVar(value='Off')
1056 fPpmType = ttk.Frame(fPpm)
1057 ppmTypeVar = StringVar(value='Rx chanel')
1058 ppmPinVar = IntVar(value = 2)
1059 ppmForMin100Var = IntVar(value = 1000)
1060 ppmForPlus100Var = IntVar(value = 2000)
1062 imuPinVar = IntVar(value = 3)
1063 imuDisplayOffset = StringVar(value='Off')
1064 imuOffsetXVar = IntVar(value=0)
1065 imuOffsetYVar = IntVar(value=0)
1066 imuOffsetZVar = IntVar(value=0)
1068 flowPulsesmlVar = IntVar(value = 10)
1069 flowTankCapVar = IntVar(value = 1000)
1070 flowL1ValueVar = IntVar(value = 0)
1071 flowL1CorrVar = IntVar(value = 0)
1072 flowL2ValueVar = IntVar(value = 0)
1073 flowL2CorrVar = IntVar(value = 0)
1074 flowL3ValueVar = IntVar(value = 0)
1075 flowL3CorrVar = IntVar(value = 0)
1076 flowL4ValueVar = IntVar(value = 0)
1077 flowL4CorrVar = IntVar(value = 0)
1078 flowPPMResetVar = IntVar(value = 95)
1080 pushButtPinVar = IntVar(value = 10)
1082 GeneratemagCalData = StringVar(value='Off')
1083 xMagOffsetVar= IntVar(value=0)
1084 yMagOffsetVar= IntVar(value=0)
1085 zMagOffsetVar= IntVar(value=0)
1086 xxMagCorrectionVar = DoubleVar(value=0)
1087 xyMagCorrectionVar = DoubleVar(value=0)
1088 xzMagCorrectionVar = DoubleVar(value=0)
1089 yxMagCorrectionVar = DoubleVar(value=0)
1090 yyMagCorrectionVar = DoubleVar(value=0)
1091 yzMagCorrectionVar = DoubleVar(value=0)
1092 zxMagCorrectionVar = DoubleVar(value=0)
1093 zyMagCorrectionVar = DoubleVar(value=0)
1094 zzMagCorrectionVar = DoubleVar(value=0)
1096 varioTypeVar = StringVar(value='MS5611')
1098 secondBaroExist = StringVar(value='Off')
1099 varioSourceVar = StringVar(value='FIRST_BARO')
1100 varioHysteresisVar = IntVar(value=5)
1103 fAnalogVario = ttk.Frame(fVario)
1104 analogVarioExist = StringVar(value='Off')
1105 varioAnalogPinVar = StringVar(value='3')
1106 varioAnalogMinVar = DoubleVar(value=-3)
1107 varioAnalogMaxVar = DoubleVar(value=3)
1109 airspeedTypeVar = StringVar(value='MS4525')
1110 airspeedAtSea15CVar = StringVar(value='Off')
1111 airspeedInKmhVar = StringVar(value='Off')
1112 airspeedResetAtPpmVar = IntVar(value=100)
1113 airspeedCompMinAtPpmVar = IntVar(value=60)
1114 airspeedCompMaxAtPpmVar = IntVar(value=90)
1115 airspeedCompMinVar = IntVar(value=80)
1116 airspeedCompMaxVar = IntVar(value=140)
1118 Adc0TypeVar= StringVar(value='ADS_OFF')
1119 Adc1TypeVar= StringVar(value='ADS_OFF')
1120 Adc2TypeVar= StringVar(value='ADS_OFF')
1121 Adc3TypeVar= StringVar(value='ADS_OFF')
1122 Adc0FsVar= StringVar(value='MV6144')
1123 Adc1FsVar= StringVar(value='MV6144')
1124 Adc2FsVar= StringVar(value='MV6144')
1125 Adc3FsVar= StringVar(value='MV6144')
1126 Adc0OffVar = IntVar(value=0)
1127 Adc1OffVar = IntVar(value=0)
1128 Adc2OffVar = IntVar(value=0)
1129 Adc3OffVar = IntVar(value=0)
1130 Adc0ScVar = DoubleVar(value=1)
1131 Adc1ScVar = DoubleVar(value=1)
1132 Adc2ScVar = DoubleVar(value=1)
1133 Adc3ScVar = DoubleVar(value=1)
1134 Adc0CrVar= StringVar(value='MS2')
1135 Adc1CrVar= StringVar(value='MS2')
1136 Adc2CrVar= StringVar(value='MS2')
1137 Adc3CrVar= StringVar(value='MS2')
1138 Adc0AvgVar = IntVar(value=10)
1139 Adc1AvgVar = IntVar(value=10)
1140 Adc2AvgVar = IntVar(value=10)
1141 Adc3AvgVar = IntVar(value=10)
1142 AdcCurrVar = StringVar(value='NO')
1143 AdcSpVar = StringVar(value='NO')
1145 volt1Exist = StringVar(value='Off')
1146 volt2Exist = StringVar(value='Off')
1147 volt3Exist = StringVar(value='Off')
1148 volt4Exist = StringVar(value='Off')
1149 volt5Exist = StringVar(value='Off')
1150 volt6Exist = StringVar(value='Off')
1151 volt1PinVar = StringVar(value='0')
1152 volt2PinVar = StringVar(value='1')
1153 volt3PinVar = StringVar(value='2')
1154 volt4PinVar = StringVar(value='3')
1155 volt5PinVar = StringVar(value='6')
1156 volt6PinVar = StringVar(value='7')
1158 volt1RgVar = DoubleVar(value='0.0')
1159 volt2RgVar = DoubleVar(value='0.0')
1160 volt3RgVar = DoubleVar(value='0.0')
1161 volt4RgVar = DoubleVar(value='0.0')
1162 volt5RgVar = DoubleVar(value='0.0')
1163 volt6RgVar = DoubleVar(value='0.0')
1165 volt1RvVar = DoubleVar(value='0.0')
1166 volt2RvVar = DoubleVar(value='0.0')
1167 volt3RvVar = DoubleVar(value='0.0')
1168 volt4RvVar = DoubleVar(value='0.0')
1169 volt5RvVar = DoubleVar(value='0.0')
1170 volt6RvVar = DoubleVar(value='0.0')
1172 volt1ScaleVar = DoubleVar(value='1.0')
1173 volt2ScaleVar = DoubleVar(value='1.0')
1174 volt3ScaleVar = DoubleVar(value='1.0')
1175 volt4ScaleVar = DoubleVar(value='1.0')
1176 volt5ScaleVar = DoubleVar(value='1.0')
1177 volt6ScaleVar = DoubleVar(value='1.0')
1179 volt1OffsetVar = DoubleVar(value='0.0')
1180 volt2OffsetVar = DoubleVar(value='0.0')
1181 volt3OffsetVar = DoubleVar(value='0.0')
1182 volt4OffsetVar = DoubleVar(value='0.0')
1183 volt5OffsetVar = DoubleVar(value='0.0')
1184 volt6OffsetVar = DoubleVar(value='0.0')
1186 voltNumberOfCellsVar = StringVar(value='0')
1187 voltReferenceVar = StringVar(value='Internal')
1188 voltRefValueVar = IntVar(value='5000')
1190 currentPinVar = StringVar(value='0')
1191 currentMvoltAt0Var = DoubleVar(value='0.0')
1192 currentMvoltPerAmpVar = DoubleVar(value='0.0')
1193 currentRgVar = DoubleVar(value='0.0')
1194 currentRcVar = DoubleVar(value='0.0')
1196 pulsesPerRotationVar = IntVar(value=2)
1198 pushButtonPin=StringVar(value='10')
1200 gps3dExist = StringVar(value='Off')
1201 gpsTimeExist = StringVar(value='Off')
1202 gpsRateVar = StringVar(value='5')
1204 SeqUnitVar = IntVar(value='1')
1205 SeqMinVoltVar = IntVar(value='0')
1206 SeqMinCellVar = IntVar(value='0')
1207 SeqOut1Var = StringVar(value='0')
1208 SeqOut2Var = StringVar(value='0')
1209 SeqOut3Var = StringVar(value='0')
1210 SeqOut4Var = StringVar(value='0')
1211 SeqOut5Var = StringVar(value='0')
1212 SeqOut6Var = StringVar(value='0')
1213 SeqB5Var = []
1214 SeqB4Var = []
1215 SeqB3Var = []
1216 SeqB2Var = []
1217 SeqB1Var = []
1218 SeqB0Var = []
1219 SeqTVar = []
1221 for x in range(0,100):
1222 SeqB0Var.append(IntVar(value='0'))
1223 SeqB1Var.append(IntVar(value='0'))
1224 SeqB2Var.append(IntVar(value='0'))
1225 SeqB3Var.append(IntVar(value='0'))
1226 SeqB4Var.append(IntVar(value='0'))
1227 SeqB5Var.append(IntVar(value='0'))
1228 SeqTVar.append(StringVar(value=''))
1230 fFillTest3ExpectedAltitude = ttk.Frame(fAddFields)
1231 fillTest3ExpectedAltitudeVar = StringVar(value='Off')
1232 expAltTimeVar = DoubleVar(value='1.5')
1233 fillTest1VarioTemperatureVar = StringVar(value='Off')
1234 fillTest2VarioTemperatureVar = StringVar(value='Off')
1235 fillTest3VarioTemperatureVar = StringVar(value='Off')
1236 fillTest123LinearAccVar = StringVar(value='Off')
1237 fillTest12VspeedAltVar = StringVar(value='Off')
1238 fillTest1DteVar = StringVar(value='Off')
1239 fillTest2PpmAirspeedCompVar = StringVar(value='Off')
1240 fillTest1YawRateVar = StringVar(value='Off')
1241 fillTest1HeadingVar = StringVar(value='Off')
1242 fillTest123FlowVar = StringVar(value='Off')
1243 fillTest1GpsNbrSatVar = StringVar(value='Off')
1244 fillTest2GpsHdopVar = StringVar(value='Off')
1246 protocolVar = StringVar(value='FRSKY_SPORT')
1247 pinToRxVar = StringVar(value='4')
1249 frskyVfasVar= StringVar(value='Not sent')
1250 frskyFuelVar= StringVar(value='Not sent')
1251 frskyA3Var= StringVar(value='Not sent')
1252 frskyA4Var= StringVar(value='Not sent')
1253 frskyAccxVar= StringVar(value='Not sent')
1254 frskyAccyVar= StringVar(value='Not sent')
1255 frskyAcczVar= StringVar(value='Not sent')
1256 frskyT1Var= StringVar(value='Not sent')
1257 frskyT2Var= StringVar(value='Not sent')
1259 multiplexLine1Var = StringVar(value='Not sent')
1260 multiplexLine2Var = StringVar(value='Not sent')
1261 multiplexLine3Var = StringVar(value='Not sent')
1262 multiplexLine4Var = StringVar(value='Not sent')
1263 multiplexLine5Var = StringVar(value='Not sent')
1264 multiplexLine6Var = StringVar(value='Not sent')
1265 multiplexLine7Var = StringVar(value='Not sent')
1266 multiplexLine8Var = StringVar(value='Not sent')
1267 multiplexLine9Var = StringVar(value='Not sent')
1269 hottCellUndervoltageVar = IntVar(value=3300)
1270 hottBattery1SourceVar = StringVar(value='Not sent')
1271 hottBattery2SourceVar = StringVar(value='Not sent')
1272 hottMainBatterySourceVar = StringVar(value='Not sent')
1273 hottT1SourceVar = StringVar(value='Not sent')
1274 hottT2SourceVar = StringVar(value='Not sent')
1276 jetiVoltageSourceVar = StringVar(value='Not sent')
1277 jetiTemperatureSourceVar = StringVar(value='Not sent')